<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 4.2.0">
  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png">
  <link rel="mask-icon" href="/images/logo.svg" color="#222">

<link rel="stylesheet" href="/css/main.css">


<link rel="stylesheet" href="/lib/font-awesome/css/all.min.css">

<script id="hexo-configurations">
    var NexT = window.NexT || {};
    var CONFIG = {"hostname":"yoursite.com","root":"/","scheme":"Muse","version":"7.8.0","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":false,"show_result":false,"style":null},"back2top":{"enable":true,"sidebar":false,"scrollpercent":false},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":false,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}}};
  </script>

  <meta name="description" content="读取系统信息，生成配置文件利用python写一段程序来读取电脑的硬件信息，并存到txt文件中，要求win7，win10系统可用。 最好的办法就是用批处理，windows系统原生支持，不需要在额外添加执行环境，但是既然是搞python，我们就需要折腾一下了。">
<meta property="og:type" content="article">
<meta property="og:title" content="读取硬件信息，生成配置文件">
<meta property="og:url" content="http://yoursite.com/2020/06/04/%E8%AF%BB%E5%8F%96%E7%A1%AC%E4%BB%B6%E4%BF%A1%E6%81%AF%EF%BC%8C%E7%94%9F%E6%88%90%E9%85%8D%E7%BD%AE%E6%96%87%E4%BB%B6/index.html">
<meta property="og:site_name" content="编程学习笔记">
<meta property="og:description" content="读取系统信息，生成配置文件利用python写一段程序来读取电脑的硬件信息，并存到txt文件中，要求win7，win10系统可用。 最好的办法就是用批处理，windows系统原生支持，不需要在额外添加执行环境，但是既然是搞python，我们就需要折腾一下了。">
<meta property="og:locale" content="zh_CN">
<meta property="article:published_time" content="2020-06-04T00:14:46.397Z">
<meta property="article:modified_time" content="2020-06-04T00:16:03.439Z">
<meta property="article:author" content="szj">
<meta name="twitter:card" content="summary">

<link rel="canonical" href="http://yoursite.com/2020/06/04/%E8%AF%BB%E5%8F%96%E7%A1%AC%E4%BB%B6%E4%BF%A1%E6%81%AF%EF%BC%8C%E7%94%9F%E6%88%90%E9%85%8D%E7%BD%AE%E6%96%87%E4%BB%B6/">


<script id="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome : false,
    isPost : true,
    lang   : 'zh-CN'
  };
</script>

  <title>读取硬件信息，生成配置文件 | 编程学习笔记</title>
  






  <noscript>
  <style>
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header { opacity: initial; }

  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript>

</head>

<body itemscope itemtype="http://schema.org/WebPage">
  <div class="container use-motion">
    <div class="headband"></div>

    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏">
      <span class="toggle-line toggle-line-first"></span>
      <span class="toggle-line toggle-line-middle"></span>
      <span class="toggle-line toggle-line-last"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/" class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <h1 class="site-title">编程学习笔记</h1>
      <span class="logo-line-after"><i></i></span>
    </a>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
    </div>
  </div>
</div>




<nav class="site-nav">
  <ul id="menu" class="main-menu menu">
        <li class="menu-item menu-item-home">

    <a href="/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a>

  </li>
        <li class="menu-item menu-item-archives">

    <a href="/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档</a>

  </li>
  </ul>
</nav>




</div>
    </header>

    
  <div class="back-to-top">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>


    <main class="main">
      <div class="main-inner">
        <div class="content-wrap">
          

          <div class="content post posts-expand">
            

    
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="http://yoursite.com/2020/06/04/%E8%AF%BB%E5%8F%96%E7%A1%AC%E4%BB%B6%E4%BF%A1%E6%81%AF%EF%BC%8C%E7%94%9F%E6%88%90%E9%85%8D%E7%BD%AE%E6%96%87%E4%BB%B6/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="szj">
      <meta itemprop="description" content="">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="编程学习笔记">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          读取硬件信息，生成配置文件
        </h1>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>
              

              <time title="创建时间：2020-06-04 08:14:46 / 修改时间：08:16:03" itemprop="dateCreated datePublished" datetime="2020-06-04T08:14:46+08:00">2020-06-04</time>
            </span>

          

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
        <h1 id="读取系统信息，生成配置文件"><a href="#读取系统信息，生成配置文件" class="headerlink" title="读取系统信息，生成配置文件"></a>读取系统信息，生成配置文件</h1><p>利用python写一段程序来读取电脑的硬件信息，并存到txt文件中，要求win7，win10系统可用。</p>
<p>最好的办法就是用批处理，windows系统原生支持，不需要在额外添加执行环境，但是既然是搞python，我们就需要折腾一下了。</p>
<a id="more"></a>

<h2 id="先上代码"><a href="#先上代码" class="headerlink" title="先上代码"></a>先上代码</h2><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br><span class="line">98</span><br><span class="line">99</span><br><span class="line">100</span><br><span class="line">101</span><br><span class="line">102</span><br><span class="line">103</span><br><span class="line">104</span><br><span class="line">105</span><br><span class="line">106</span><br><span class="line">107</span><br><span class="line">108</span><br><span class="line">109</span><br><span class="line">110</span><br><span class="line">111</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">#!/usr/bin/env python</span></span><br><span class="line"><span class="comment"># -*- coding: utf-8 -*-</span></span><br><span class="line"><span class="keyword">import</span> os, sys</span><br><span class="line"><span class="keyword">import</span> wmi</span><br><span class="line">c = wmi.WMI()</span><br><span class="line">f = open (<span class="string">'pcinfo.txt'</span>,<span class="string">"w"</span>)</span><br><span class="line"><span class="comment"># 处理器</span></span><br><span class="line"><span class="function"><span class="keyword">def</span> <span class="title">printCPU</span><span class="params">()</span>:</span></span><br><span class="line">    <span class="keyword">for</span> cpu <span class="keyword">in</span> c.Win32_Processor():</span><br><span class="line">        CpuType = cpu.Name</span><br><span class="line">        systemName = cpu.SystemName        </span><br><span class="line">        CpuClock = cpu.MaxClockSpeed </span><br><span class="line">        DataWidth = cpu.DataWidth</span><br><span class="line">        <span class="keyword">print</span> (<span class="string">"systemName: %s"</span>%cpu.SystemName)</span><br><span class="line">        <span class="keyword">print</span> (<span class="string">"CpuType: %s"</span>%cpu.Name)</span><br><span class="line">        <span class="keyword">print</span> (<span class="string">"CpuClock: %s"</span>%cpu.MaxClockSpeed)</span><br><span class="line">        <span class="keyword">print</span> (<span class="string">"CpuDataWidth: %s"</span>%cpu.DataWidth)</span><br><span class="line">        f.write(<span class="string">"计算机名：%s"</span>%cpu.SystemName)</span><br><span class="line">        f.write(<span class="string">"\n"</span>)</span><br><span class="line">        f.write(<span class="string">"CPU型号：%s"</span>%cpu.Name)</span><br><span class="line">        f.write(<span class="string">"\n"</span>)</span><br><span class="line">        f.write(<span class="string">"CPU频率：%s"</span>%cpu.MaxClockSpeed)</span><br><span class="line">        f.write(<span class="string">"\n"</span>)</span><br><span class="line">        f.write(<span class="string">"CPU带宽：%s"</span>%cpu.DataWidth)</span><br><span class="line">        f.write(<span class="string">"\n"</span>)</span><br><span class="line">       </span><br><span class="line"><span class="comment"># 主板</span></span><br><span class="line"><span class="function"><span class="keyword">def</span> <span class="title">printMain_board</span><span class="params">()</span>:</span></span><br><span class="line">    <span class="keyword">for</span> board_id <span class="keyword">in</span> c.Win32_BaseBoard():        </span><br><span class="line">        SerialNumber = board_id.SerialNumber  <span class="comment"># 主板序列号</span></span><br><span class="line">        Manufacturer = board_id.Manufacturer  <span class="comment"># 主板生产品牌厂家</span></span><br><span class="line">        Product = board_id.Product  <span class="comment"># 主板型号        </span></span><br><span class="line">        <span class="keyword">print</span> (<span class="string">"MainboardSerialNumber: %s"</span>%board_id.SerialNumber)</span><br><span class="line">        <span class="keyword">print</span> (<span class="string">"MainboardManufacturer: %s"</span>%board_id.Manufacturer)</span><br><span class="line">        <span class="keyword">print</span> (<span class="string">"MainboardProduct: %s"</span>%board_id.Product)</span><br><span class="line">        f.write(<span class="string">"主板序列号:%s"</span>%board_id.SerialNumber)</span><br><span class="line">        f.write(<span class="string">"\n"</span>)</span><br><span class="line">        f.write(<span class="string">"主板生产品牌厂家:%s"</span>%board_id.Manufacturer)</span><br><span class="line">        f.write(<span class="string">"\n"</span>)</span><br><span class="line">        f.write(<span class="string">"主板型号:%s"</span>%board_id.Product)</span><br><span class="line">        f.write(<span class="string">"\n"</span>)</span><br><span class="line"> </span><br><span class="line"></span><br><span class="line"><span class="comment"># BIOS</span></span><br><span class="line"><span class="function"><span class="keyword">def</span> <span class="title">printBIOS</span><span class="params">()</span>:</span></span><br><span class="line">    bioss = []</span><br><span class="line">    <span class="keyword">for</span> bios_id <span class="keyword">in</span> c.Win32_BIOS():        </span><br><span class="line">        version = bios_id.Version  <span class="comment"># BIOS版本</span></span><br><span class="line">        Manufacturer = bios_id.Manufacturer.strip()  <span class="comment"># BIOS固件生产厂家</span></span><br><span class="line">        ReleaseDate = bios_id.ReleaseDate  <span class="comment"># BIOS释放日期</span></span><br><span class="line">        SMBIOSBIOSVersion = bios_id.SMBIOSBIOSVersion  <span class="comment"># 系统管理规范版本    print ("Biosversion: %s"%bios_id.Version)</span></span><br><span class="line">        <span class="keyword">print</span> (<span class="string">"BiosManufacturer: %s"</span>%bios_id.Manufacturer.strip())</span><br><span class="line">        <span class="keyword">print</span> (<span class="string">"BiosReleaseDate: %s"</span>%bios_id.ReleaseDate)</span><br><span class="line">        <span class="keyword">print</span> (<span class="string">"BiosSMBIOSBIOSVersion: %s"</span>%bios_id.SMBIOSBIOSVersion)</span><br><span class="line">        f.write (<span class="string">"BIOS固件生产厂家: %s"</span>%bios_id.Manufacturer.strip())</span><br><span class="line">        f.write(<span class="string">"\n"</span>)</span><br><span class="line">        f.write(<span class="string">"BIOS释放日期: %s"</span>%bios_id.ReleaseDate)</span><br><span class="line">        f.write(<span class="string">"\n"</span>)</span><br><span class="line">        f.write(<span class="string">"系统管理规范版本: %s"</span>%bios_id.SMBIOSBIOSVersion)</span><br><span class="line">        f.write(<span class="string">"\n"</span>)</span><br><span class="line">    </span><br><span class="line"><span class="comment"># 硬盘</span></span><br><span class="line"><span class="function"><span class="keyword">def</span> <span class="title">printDisk</span><span class="params">()</span>:</span>    </span><br><span class="line">    <span class="keyword">for</span> disk <span class="keyword">in</span> c.Win32_DiskDrive():</span><br><span class="line">        Caption = disk.Caption</span><br><span class="line">        Size = disk.Size        </span><br><span class="line">        <span class="keyword">print</span> (<span class="string">"DiskModel: %s"</span>%disk.Caption)</span><br><span class="line">        <span class="keyword">print</span> (<span class="string">"DiskSize: %s"</span>%disk.Size)</span><br><span class="line">        f.write (<span class="string">"硬盘型号: %s"</span>%disk.Caption)</span><br><span class="line">        f.write(<span class="string">"\n"</span>)</span><br><span class="line">        f.write(<span class="string">"硬盘容量: %s"</span>%disk.Size)</span><br><span class="line">        f.write(<span class="string">"\n"</span>)</span><br><span class="line"></span><br><span class="line"><span class="comment"># 内存</span></span><br><span class="line"><span class="function"><span class="keyword">def</span> <span class="title">printPhysicalMemory</span><span class="params">()</span>:</span>   </span><br><span class="line">    <span class="keyword">for</span> mem <span class="keyword">in</span> c.Win32_PhysicalMemory():</span><br><span class="line">        Capacity = mem.Capacity   </span><br><span class="line">        <span class="keyword">print</span> (<span class="string">"MemeryCapacity: %s"</span>%Capacity)</span><br><span class="line">        f.write(<span class="string">"内存容量: %s"</span>%Capacity)</span><br><span class="line">        f.write(<span class="string">"\n"</span>)</span><br><span class="line"><span class="comment"># 电池信息，只有笔记本才会有电池选项</span></span><br><span class="line"><span class="function"><span class="keyword">def</span> <span class="title">printBattery</span><span class="params">()</span>:</span></span><br><span class="line">    isBatterys = <span class="literal">False</span></span><br><span class="line">    <span class="keyword">for</span> b <span class="keyword">in</span> c.Win32_Battery():</span><br><span class="line">        isBatterys = <span class="literal">True</span></span><br><span class="line">    <span class="keyword">return</span> isBatterys</span><br><span class="line"></span><br><span class="line"><span class="comment">#获取MAC和IP地址</span></span><br><span class="line"><span class="function"><span class="keyword">def</span> <span class="title">network</span><span class="params">()</span>:</span> </span><br><span class="line">    <span class="keyword">for</span> interface <span class="keyword">in</span> c.Win32_NetworkAdapterConfiguration (IPEnabled=<span class="number">1</span>):</span><br><span class="line">        <span class="keyword">print</span> (<span class="string">"MAC: %s"</span> % interface.MACAddress)</span><br><span class="line">        f.write(<span class="string">"MAC地址: %s"</span> % interface.MACAddress)</span><br><span class="line">        f.write(<span class="string">"\n"</span>)</span><br><span class="line">    <span class="comment">#for ip_address in interface.IPAddress:</span></span><br><span class="line">        <span class="keyword">print</span> (<span class="string">"ip_add: %s"</span> % interface.IPAddress[<span class="number">0</span>])</span><br><span class="line">        f.write(<span class="string">"ip地址: %s"</span> % interface.IPAddress[<span class="number">0</span>])</span><br><span class="line">        f.write(<span class="string">"\n"</span>)</span><br><span class="line"><span class="function"><span class="keyword">def</span> <span class="title">main</span><span class="params">()</span>:</span></span><br><span class="line"></span><br><span class="line">    printCPU()</span><br><span class="line">    printMain_board()</span><br><span class="line">    printBIOS()</span><br><span class="line">    printDisk()</span><br><span class="line">    printPhysicalMemory()   </span><br><span class="line">    printBattery()</span><br><span class="line">    network()</span><br><span class="line">    f.close()</span><br><span class="line"><span class="keyword">if</span> __name__ == <span class="string">'__main__'</span>:</span><br><span class="line">    main()</span><br><span class="line">print(<span class="string">"\r\n"</span>)</span><br><span class="line">input(<span class="string">"系统信息已保存到同目录下的pcinfo.txt文件中\r\nPress Enter to exit"</span>)</span><br></pre></td></tr></table></figure>

<h2 id="编译为exe文件"><a href="#编译为exe文件" class="headerlink" title="编译为exe文件"></a>编译为exe文件</h2><p>如果目标机没有python环境，还是要运行这个程序，就需要吧py文件打包成在Windows下可执行的exe文件了。</p>
<p>使用PyInstaller将Python脚本打包成exe可执行程序。</p>
<p>首先，安装 pyinstaller</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">pip install pyinstaller</span><br></pre></td></tr></table></figure>

<p>进入python需要打包的脚本所在目录，然后执行简单打包命令即可：</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">pyinstaller -F *.py</span><br></pre></td></tr></table></figure>

<p>打包完成后，进入到当前目录下，会发现多了build、dist、*.spec这四个文件夹或者文件，其中打包好的exe应用在dist目录下面，进入即可看到，可以把他拷贝到其他地方直接使用</p>
<h2 id="pyinstaller的更多选项"><a href="#pyinstaller的更多选项" class="headerlink" title="pyinstaller的更多选项"></a>pyinstaller的更多选项</h2><p>通过<code>pyinstaller --help</code>查看其他参数。</p>

    </div>

    
    
    

      <footer class="post-footer">

        


        
    <div class="post-nav">
      <div class="post-nav-item">
    <a href="/2020/05/29/%E7%94%A8js%E5%9C%A8%E9%A1%B5%E9%9D%A2%E7%94%9F%E6%88%90button/" rel="prev" title="用js在页面生成button">
      <i class="fa fa-chevron-left"></i> 用js在页面生成button
    </a></div>
      <div class="post-nav-item">
    <a href="/2020/06/10/%E7%94%A8js%E4%B8%8B%E8%BD%BD%E3%80%8A%E9%97%AE%E5%8D%B7%E6%98%9F%E3%80%8B%E7%9A%84%E9%97%AE%E5%8D%B7/" rel="next" title="用js下载《问卷星》的问卷">
      用js下载《问卷星》的问卷 <i class="fa fa-chevron-right"></i>
    </a></div>
    </div>
      </footer>
    
  </article>
  
  
  



          </div>
          

<script>
  window.addEventListener('tabs:register', () => {
    let { activeClass } = CONFIG.comments;
    if (CONFIG.comments.storage) {
      activeClass = localStorage.getItem('comments_active') || activeClass;
    }
    if (activeClass) {
      let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
      if (activeTab) {
        activeTab.click();
      }
    }
  });
  if (CONFIG.comments.storage) {
    window.addEventListener('tabs:click', event => {
      if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
      let commentClass = event.target.classList[1];
      localStorage.setItem('comments_active', commentClass);
    });
  }
</script>

        </div>
          
  
  <div class="toggle sidebar-toggle">
    <span class="toggle-line toggle-line-first"></span>
    <span class="toggle-line toggle-line-middle"></span>
    <span class="toggle-line toggle-line-last"></span>
  </div>

  <aside class="sidebar">
    <div class="sidebar-inner">

      <ul class="sidebar-nav motion-element">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <!--noindex-->
      <div class="post-toc-wrap sidebar-panel">
          <div class="post-toc motion-element"><ol class="nav"><li class="nav-item nav-level-1"><a class="nav-link" href="#读取系统信息，生成配置文件"><span class="nav-number">1.</span> <span class="nav-text">读取系统信息，生成配置文件</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#先上代码"><span class="nav-number">1.1.</span> <span class="nav-text">先上代码</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#编译为exe文件"><span class="nav-number">1.2.</span> <span class="nav-text">编译为exe文件</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#pyinstaller的更多选项"><span class="nav-number">1.3.</span> <span class="nav-text">pyinstaller的更多选项</span></a></li></ol></li></ol></div>
      </div>
      <!--/noindex-->

      <div class="site-overview-wrap sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
  <p class="site-author-name" itemprop="name">szj</p>
  <div class="site-description" itemprop="description"></div>
</div>
<div class="site-state-wrap motion-element">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
          <a href="/archives/">
        
          <span class="site-state-item-count">18</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
  </nav>
</div>



      </div>

    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


      </div>
    </main>

    <footer class="footer">
      <div class="footer-inner">
        

        

<div class="copyright">
  
  &copy; 
  <span itemprop="copyrightYear">2020</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">szj</span>
</div>
  <div class="powered-by">由 <a href="https://hexo.io/" class="theme-link" rel="noopener" target="_blank">Hexo</a> & <a href="https://muse.theme-next.org/" class="theme-link" rel="noopener" target="_blank">NexT.Muse</a> 强力驱动
  </div>

        








      </div>
    </footer>
  </div>

  
  <script src="/lib/anime.min.js"></script>
  <script src="/lib/velocity/velocity.min.js"></script>
  <script src="/lib/velocity/velocity.ui.min.js"></script>

<script src="/js/utils.js"></script>

<script src="/js/motion.js"></script>


<script src="/js/schemes/muse.js"></script>


<script src="/js/next-boot.js"></script>




  















  

  

</body>
</html>
